package com.caoyuqi.picture.mapper;

import com.caoyuqi.picture.model.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface LoginMapper {
    @Select("select * from user where username = #{username} and pwd = #{pwd}")
    User queryLogin(String username, String pwd);

    @Select("select * from user limit 0 , 10")
    ArrayList<User> queryAll();

    @Select("select * from user where username = #{username} and pwd = #{pwd}")
    User isAdmin(String username, String pwd, String admin);
    @Select("SELECT admin from user where username = #{user}")
    String queryAdmin(String user);
}
